package simpleocr;


import java.io.File;
import java.io.IOException;

/**
 * @author tony
 * @date 2021/3/29 14:34
 */
public class OcrTest {

    public static void main(String[] args) {
        //替换图片路径
        String path = "E://tesseract//testpicture//8.jpg";
        System.out.println("OCR Test Begin......");
        try {
            String valCode = new OCR().recognizeText(new File(path), path.substring(path.indexOf(".")+1,path.length()));
            System.out.println(valCode);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("OCR Test End......");
    }

}


